maxflow works