Upate Cosine similarity