changed binning procedure