Minor changes.
Setup base for implementing maximum flow algerithms.
Major refactoring.