algorithm: lcs: adding code for LCS calculations