Use forEach instead of for loop