created var math for else if