actually fixed bugs in histogram