Iterate over array correctly