Rewrote the sinGen function. It now has most of the functionality that I need.