Improvements on script.js