Improved comments and implemented flowToMatching.