code documentation

Some suberb documentation in the index.js.