moved LCS method into this module