Using global namespace to save state