Version 2: switched to a freeform rules system.