added code to compute a^k1 % p

Way I did it was do $f3 / p (f3 is a^k1), convert that to an integer
than back to a float to get rid of decimal places, than multiply it by
p, than do $f3 - previous.
The formula is "a mod n = a - n * floor(a/n)"