added master and switching modules to handle switches and output waveforms