1. Improved the constructor. Now it has better performance when data is vary large (e.g. >1M). 2. Fixed line 99. When bin==numBins, the value falls on the next bin of the max bin, not right on the edge.