merged the training label file cleanup code to main program