Quick Sort with new features