added longest common subsequence