added cosine