added lcs algorithm