improved exp() and moved it to exp.py