Refactored code to take better advantage of forEach closures.
2.1.1