added function getTreeRoots