new sinewave class taken from github