rename function fastpow->powermod for correct meaning