add addElement and print methods for tree