added maxflow transform