fixed factor multiplication to use the new structure. simplified code by reusing code that was copied before. added a test for factor multiplication