Update functions.js