Implemented tail-recursive quicksort