working on rule-based system