Updated qsort pivot selection