Updated to make the hoisting example more clear

Also fixed code so that it runs correctly (using the same function name
lead to the second function to be called twice).