QuickSort implementation working correctly when pivot is first element