coded up hmf, needs running and bugchecking.