How to use exec to do the math work in