Use median-of-three pivot