Move veriable declarations to the top of the ID function.