Added a for loop and foreach loop