move variables to top of script