Incorporated a for loop and a forEach loop for practice