More efficient label population in mlp.m