updated get_peaks to produce nice plots