Change to iterative solution using Enum.map_join

I still prefer the recursive solution, but I like this one too.
It would be interesting to benchmark the two solutions to see which
was more efficient.