get rid of for loop and replace with forEach