iterating array working