correct use of modulo operator