Update to Longest Common Substring algorithm

Fixed to the Longest Common Substring algorithm. It now finds the
correct longest common substring. However, it is highly inefficient in
most cases.