added non-recursive factorial capability