Update functionality.js