improve depth-2 search for neighbors