build subtree