Added longest common substring algorithm