Work on binning function.