passing tests, completed index.js