Added a lot of binning functionality