works with histogram callback
better const correctness; removed using namespace std