wrapping in self-invoking anonymous function so as not to populate global namespace