quicksort works until sort to pivot