subtree function

Extract a subtree from a segmented PST