additions to tree functions