Added codes to generate the graphs