QuickSort implementation