added calculate neighbors function and tested with printing it