Add items to a dictionary and format output