subtree extraction