added label sorting