My rewrite of NMH