modify maxflow