simpler get_ancestors