adapted get_required_contingencies so ! and x are considered