beginning lcs function for longest commun subsequence