rewrite of the maximal matching algorithm, use Either, remove the probably wrong augmenting path function