small change to scope of variables

just making sure we don't mess around with globals where we don't want
to