Chris Mabe Homework 8

Again, check node1 and node2 for safety before using.