Update factory2.cpp