added Hat and HatTest file