working version of radixsort