added mean h code