Adding comments and JS doc
I can't spell.. it's late.