Modified hook.c