fixed isAdjacent