variables should be declared at the top of functions.