tidy up code for MW experiment with peakshape