bug fixing in findneighbours