Implemented Potential algo from paper, fixed small bugs in Flow algo