Update calculate.js

Added some comments