Cosine Similarities problem solution