mod arith library revised.