Move the declaration of the static arrays at the top of the function.