add the non-recursive quicksort version