Source: https://faculty.ung.edu/kmelton/Documents/CreatingHistograms.pdf