fixed a bug where a bin outside the histogram was selected. Need to
implement adaptive windows, and an adaptive algorithm for bin sizes,
this is terrible to need to fix beforehand... smoothness criteria
perhaps?