Added cosine method