Debugging histogram code