refactored variable environment size (depending on -g switch)