I had to replace the stuff to generate the optimizer work.

P.S. I hate triginometry!