with Christian's changes to use .pop, .setdefault, and random.choices