some changes to quicksort