Looping through an array. Printing results