working quicksort