modified QuickSort