Changed the defaultdict function to bool.