Rearrange getHist: move function declarations to the header file