First commit with some quick code put in main; untested