fixed issue with debug precedence
cleanup and instrumentation, error seems to be in fillSineWave, possibly due to variable visibility?