modified the library sum.js