Some stupid LCS function for siid