Added new functions for modular arithmetic and exponentiation