Update to index.js (work in progress)