improved neighbor search