new data structure for the waveform
small memory optimization
speed up the waveform drawing algorithm