doTree in function
...work
........work