Change check neigbour algorithm