Is it legal do declare this where you do? I'm mostly an embedded guy and this kind of dynamic declaration is verboten. The compiler seems happy with it, but I dunno...

Code:
	int indexP1[size/2], indexP2[size/2];
Also it's dilemma not dilema (misspellings like this can get you into trouble...)