Finished addNode method for tree.