There's still a bug in histogram calculation that turns up sometimes because the number of edges does not equal the number of histogram values, since this is just for approximation we just need to trim one of the values or edges. Need to do this better.