Added code for counting sort