I've tried removing Whitespace. Also disabled wordpress auto formatting. Still no luck.
The code works perfectly outside of Wordpress.
Any ideas how to fix?
P.S. I posted the code here: