update get_subtree_roots and add unit test coverage for it