fixed check_compound_constraint, may still need some more work. detect_backtrack still not working