Update index.js

`i` was undefined
Merge pull request #13 from Hypercubed/patch-1

Update index.js