added comments to the functions in script.js
removed extra lines and spaces