Comments

Fixed one typo ($_PROJECT_ID_ instead of _PROJECT_ID_); adding comments
to functions; grouping functions together; moved hooks to come before
functions.