move all js in to functions.js, and add comment