fixed bug for cos (2*psi_n)