ADDED: powmod. Modular exponentiation