added each-neighbour method
worked out how to call a function passed as an argument