Fixing a bug in the neighbour list