v 0.6.2 - reformatted code to be more intuitive and concise

- changed loop from reversed to forward propagating (from 0 to
elements.length - 1)
- moved variables into self invoking function
corrected typo left in minified version