tweaked explore_sample.cpp