adding logic to rebuild lcs in LCS.java from lcs matrix