implemented getneighbours()