more flexible binning