Variables are not constant
Introduce new C++ functions for waveform modes
Correct some faulty imports