Counting sort implemented