Made the answer test case use the correct value
Added check for factor.  Changed the iteration method