changed variables to scope root