fixed bug in findneighbourindices