Wrote a really terrible method to check for adjacent nodes.