some changes made for treelike