move variables to top