modular exponentiation additional method