Code of the histogram function was amended