Added option to draw network graph; corrected small bug in graph generation