fixed and tidied hunter.c to be smarter