getNeighbors function; reset