made changes for code review feedback: update for loop to not use in on array, add curly braces for even one line under conditional, add new line, create variables to replace elements selector used more than once, rename for message loops