Changed world to defaultdict instead of dict