created private addHook() with a bunch of parameters to be used internally