use setdefault in other appropriate places