improving script.js