Added get_ancestors and is_root_node methods