Introduced dynamic histogram merging