added merge_hist with optional arguments (v2)