iterating through the lists and maps