coding check_rules