Updated example with cosine measures.