finds the factorial of numbers