Add modulo 97, refactoring