Some code for dot graph generating.