DG: Removed naked global, assumed variables