sort tiles to make labeling more deterministic