fixed bugs in graph visualization