Should all these variables be global? Worries me a bit.