Added adjacency check