changing to cosine