Rudimentary binning, very fragile algorithm