cleaned code at getNeighbors from findEscape

and added documentation