def smarter_nestify(l, record):
    if len(l) == 2:
        return {l[0]: l[1]}
key = l.pop(0)
record[key] = smarter_nestify(l, record.get(key, {}))
return record
how to use recursion to nest dictionaries while integrating with existing records