Adding cosine similarity calculation