finished QuickSort algorithm