fig2 code