add (and largely documented) fit_peaks() function