completely changed the rules file parser