An improvement to avoid mod 10 operation