use partition in quicksort instead of list comprehension