Added documentation to index.js