implemented factorizer, solved problem 3