declare scanner and set depending on which envVar is being set. removes order dependence for setting env Vars.