Move global declarations to the top of function; leave a new line afterwards. This make it clear, when looking at a function, what is global and what isn't.