use reduce instead of fold in factorial