Changed check_code. Only used constraint_code_compare