updated script.js

Updated the file with all necessary comments….final version