added modpow and some enc