improvements to quicksort