flatten: make it work

* tools: graph visualization