can we wrap this in a self invoking function so we don't introduce new vars to the global namespace?