generateAllRules() method written