Implemented radix sort with generic counting sort