get_neighbors function