3 node code revamped - need to test 2 nodes