cosine similarity and clustering algo implemented