Implementing treeUtil