Use imperative versus recursive LCS algorithm for speed