Adds functionality to calculate cosine similarity