first pass of binning