Copied esmond library in and temporarily fixed another histrogram issue