checking how many neighbours a cell has