hat generator - code only

refs #7