do not index bins that do not exist

if num_bins * bin_width < max_value, do not reference non-existent bins