Polish quicksort implementation