All `var`s should be declared at the top of the function to avoid potential problems with [variable hoisting](http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html).