Waveform reading almost works, but is inverted somehow?