put some variables in an anonymous function, so they don't pollute the global scope