removed bug in graph generation