pull variable decl out of for statment