making subst a monoid