Time for action – using foreach loops to retrieve data