removed some globals