Maxflow-matrix is now correct! What remains is the last two lines in the output, and then writing the result to file.