made some changes to index.js