Cosine similarity in CSA