Changes in monoid code and test to make them worrk, Konrrad's verrsion