Added precomputed powers and rem with precomputed powers.