some utility scripts for graphs. not very generic?