Improved quicksort