Don't let matchings connect to themselves
Measure distance between the correct endponts
Trying to properly account for different gap lengths
Dumping gap lengths; costs are cmpletely wrong