updated code for figures for manuscript