hmoment function