Updated ForEach with comments, and refactored some variable names