Added graph code