Implement QuickSort