complete logic formulation & variable