WIP refactor waveform drawing