Added functions to regenerate Figs. 3A and 3B