added global initalization guard, and implmented constant globals