changes to js/functions.js