add a function to measure the similarity of two sequences.