revamped quicksort