trimmed the graph code down