Histogram is working, need to clean up code