global vars removed