move neighbors into seperate function