Updated counting sort.