more rules and better output