exp and factorial implemented