deleted less efficient lcs function.