Made changes to support better binning.