added initial logic for rules
added initial logic for rules