took out ref for nodes in the constructors of node and subclasses