Added a more efficient neighbour check