added simple cosine for plain text