factorial method update