Adding foreach loop