fixed the rule generator.
need to do pruning and classification of unknown cases