We're defining globals here, and mutating them in the functions below. This works, but if another script uses the same variable names, you'll have a confusing error. It would be best to have everything here be in a closure, so that it gets its own scope. This is a good explanation: http://stackoverflow.com/questions/9773964/understanding-the-javascript-global-namespace-and-closures -- @ijl