First implementation of a system that cleans up the graphs