implementation of UCSC's binning strategy...with lots o' comments