added comments, in particular to callHook to explain process. Few tiny changes to take advantage of later version of PHP since tutorial was written