added exceptions, and nodeToObj passes test