modify histogram to use C++ list container