Updated graph drawing code