Added a function to find the factorial of a number