working counting sort