update QuickSort algorithm