finally got the forEach loop so code isn't so crazy