Correcting the generateGraph Method.