first commit of the binning routine