Code for paper in revision for American Naturalist