updated SimilarityMatrix class