Changed for to each