Added graph exporting functions (not currently called)