closed ifstreams
added rule and rulemanager class