Update the order of functions in tree