maxflow code