treeMain implementation start