Small tweaks, updated code comments, implemented waveform download.