Updated script.js

Added comments to each line of the program, should be the final edit