working on a histogramming routine, head flags computed correctly