add checkNeighbor and test methods