Replaced two filter commands with a partition command in quicksort for better performance