Correct solution to math expression.

mod operation bug fixxed