more code for tree