match_labels function

Reorder the label matrix