eval_conditions function

Evaluate conditions