edited var to include modulo formula