Never mind, I just realized you're using sin, which will cause NANs anyway :P