performance tweaks, mainly bucketing by bin width rather than size
stuff