Added function for subtrees