A function returning the factorial of a given number