rewriting arith.py
all code within functions