I have narrowed it down to the specific line of which is causing the segmentation fault.
int match[2000][2][2000];
Am I exceeding my computers memory limits with this array because my code works flawlessly when changed to this.
int match[1000][2][1000];