quick sort partition is tricky