Implemented LCS .. I hope.

Looks like it's working but haven't fully tested it yet.
Or, really, removed the debug crud.