implemented cocosine