Generic method: Histogram build