Debuging simple heuristic.
Sorting operator was ascending, swapped it.
D_xi calculation was slightly off.