Add functions for factorial and exp