added graphsaving ability - todo: update to use variables and config