revised genNeighbors