if not key in year_counts:
        year_counts[key] = 0
    year_counts[key] += 1