First attempt at LCS