Variable declarations *must* be at the start of the function, otherwise the windows compiler can't compile it.