updated functions in tree