refactor binning algorithm, with 200-250% speedup
additional speed optimization using lambda vs function.

Additional ~150% speedup, for 280% - 300% total