moved imports for mpfit and peakanalysis into functions