Completed quick sort