RP = {
    radixSort: (function() { // adapted from http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Sort/Radix/
        function digit(m, dig) {
            var str = Math.round(m).toString();

            if (dig >= str.length) {
                return 0;
            }
            return str.charAt(str.length - 1 - dig) - 0;
        }

        function pass(a, N, dig) {
            var counter = [],
                temp = [],
                i,
                d;

            for (d = 0; d <= 9; d++) {
                counter[d] = 0;
            }
            for (i = 1; i <= N; i++) {
                counter[digit(a[i], dig)]++;
            }
            for (d = 1; d <= 9; d++) {
                counter[d] += counter[d - 1];
            }
            for (i = N; i >= 1; i--) {
                temp[counter[digit(a[i], dig)]--] = a[i];
            }
            for (i = 1; i <= N; i++) {
                a[i] = temp[i];
            }

            return a;
        }

        return function(a) {
            var maxLen = 0,
                p,
                i,
                len,
                str;

            for (i = 1, len = a.length - 1; i <= len; i++) {
                str = Math.round(a[i]).toString();

                if (str.length > maxLen) {
                    maxLen = str.length;
                }
            }
            for (p = 0; p < maxLen; p++) {
                pass(a, len, p);
            }
        };
    })()
}