updated script.js

Updated script.js with the remaining code, final version