Add function to count neighbors over all cells