How to use exec functions