counting_sort implementation