traversing and calling all the scopes recursively