added documentation to script.js