potential undo freezes: compact map to avoid iteration over empty buckets