We're using global variables anyway
More style fixes
I'll admit here I don't actually know what I'm doing