fixed legacy code and graph.txt output for legacy graphs