implemented rules in generator