Wrap the whole thing in a function so as not to pollute the global namespace.