Declaring variables in local scope

Currently variables are declared in global scope rather than local scope.
They are not required globally.