Changing Factorial implementation to more efficient for loop.