Quick sort fix