Added a mod function to calc.py