added comments to functions.js