created an Immediately-Invoked Function Expression, taking out the global variable