working on index.js with associated tests