update legacy code in factorial()