added the code for finding and retracting the longest common subsequence