added save and graphing