implemented symmetry property of similarity matrix