Added setRules method.