Tail-recursive quicksort implemented