Building a maxflow class