use sort instead of QuickSort