add unit test + change the computation (now done after creating merged hists)