I am not convinced this is correct. `Mod(3x + y, 9) != Mod(x,3) + Mod(y, 9)` if for example `y == 8` and `x == 2`.