code for figures in preliminary update post