breaking down QuickSort actions into state flags - unfinished