implement legalNeighbors