HW8 (Emilijus Grasys)

Again, check node1 and node2 for safety before using.