many comments added from MATLAB source, new binning correction added
added important comment about QS
minor scope bug fixed
overhaul of profile analysis
comments added for functions to be built