changed the scope of the variables