Cleaned up the method that finds the sum of the neighbors.