Added the functions to script.js