check_dm function

Check binary variables