working on segmented scan aspect of histogramming routine