Wrap this in an anonymous function so we don't leak globals.