added longest common sequence algorithm