ooh, i never thought of doing that.
while it is quite above my level right now, i'll have to worry about this in the future anyways, so better now than never.
in terms of replacing modulus, i do have an idea, though i'm not too sure if it's less CPU intensive.
how about converting the digit to a string, finding the length of said string then converting the last character into a single digit?
it's more roundabout but it bypasses modulus, and has the same effect.