switch two pointers