Update for similarity matrix