This comment was meant for this line:

    new_children = sorted(subject_children, key=lambda k: k['data']['$area'], reverse=True)