declare variables at top of functions
ditto