Ignoring VIM swap files.
Adding some initial commentary
Working code
Made the closure more OO by pushing the calculation into the closure itself.
More thoroughly commented the code.