modified radix sort to take an extra argument