Initial revision of ruletools