Assignment 3, similarity matrix