Historgram function seems to be working