reorganizing code to reflect main results and new figures for manuscript.