code and figure edits