added argument checking for rules and a test to confirm.