finish code for relabelling