refactor getNeighbors from findEscape