Lots of bug fixing

-still need to include peakfit/bkg subtraction