iterating the array