Added semigroup and monoid support