improve label matrix

with some miner ajustments