Add similarity matrix calculation