updated script.js

Added the calculations to script.js