Basic graph code