added cosine similarity calculation in utils.