Added a function to find hooks relative to where the function is executed.