Iterates through an array and puts each element