subtree script