Rewrite lib/index.js
Merge pull request #500 from kevva/rewrite-index

Rewrite lib/index.js