fix to Neighbourhood Algorithm