Fully working quicksort