added cosine interpolation