Fix checkNeighbour algorithm, Add infinite wrapper