modification to add.labels.by.sample