minimumSpanningTree: correct the sorting
documentation: more commenting