new changes to rule generator