revamped the index.js