Trouble shooting binning algorithm