Final functionality.js