added save output figure feature