optimized graph.sh even more