move the declaration of variables to top