Added support for monoids