add adjacency check between two elements