Move the variable declarations to the start of the function.