added fn to print the LCS