most of the changes below this point in the file are just cut and paste (except for a few key pieces of #parse_content).