returns the factorial of a number