Trying to reduce nesting here ..
Refactored count_neighbors!