used setdefault for brevity.