bug fixes and generate graph completed