added preliminary hooking code