Updated quick sort function

Update the quick sort function to use a separate partition function.