added mod_pow