added a foreach loop