add non-recursive factorial