add loop to traverse key, value pairs in tuples