changes to functions.js