newest version, fixed get hait and gen_wig