add graph saving