Adding Variable Scope

Adding Variable Scope
Adding Pass by reference