Calculate mod 10 and use this as a variable