Correcting negative sorting to get participant ID