made code for different waveforms, compiles, but is untested