redesigned the tree class (still need to implement the node searching functionality)