compiled comments to make script easier to understand; no code changed
reorganised: build in flexibility for subjects with more than one dataset;  old code removed, inarg options moved downstream (right before freqanalysis code);