now using defaultdict