Modified Counting Sort