First implementation

For review
well, it makes sense to me, and the name of the variable is obvious enough. so no, i don't think it needs commenting.

why aren't all these `var`s `const`s?