Added second implementation that identifies potential concatenations first then works from this list