Implementation of QuickSort