Radix Sort with Optimizations