first version of index.js