completed quicksort