optimized: sort the selected languages