addition of names.foreach loop for exercise