Changed the sine term back to cosine.