Added ForEach function. Used in ScreenManager.