updated mod operator

accordance with euclidean definition