toString implemented for tree