update
taking into account all the data in the tree model