Update script.js

implemented "calculate"