added calculating neighbors of a cell method