Refactored QuickSort Routine