var coge = window.coge = (function(ns) {
    ns.utils = {
        ascending: function(a, b) {
            return a < b ? -1 : a > b ? 1 : 0;
        },

        descending: function(a, b) {
            return a > b ? -1 : a < b ? 1 : 0;
        },

        open: function(link) {
            window.open(link, "_self");
        },
        shuffle: function(array) {
            var copy = [], n = array.length, i = 0;

            while (n) {
                i = Math.floor(Math.random() * array.length);
                if (i in array) {
                    copy.push(array[i]);
                    delete array[i];
                    n--;
                }
            };

            return copy;
        }
    };

    return ns;
})(coge || {});

@@ -386,10 +386,22 @@
 y = 
-%5B%5D
+array.slice(0)
 , n 
@@ -420,13 +420,14 @@
 th, 
-i = 0
+tmp, i
 ;%0A%0A 
@@ -496,28 +496,19 @@
 dom() * 
-array.length
+n--
 );%0A     
@@ -522,30 +522,23 @@
     
-if (i in array) %7B%0A    
+tmp = copy%5Bn%5D;%0A
     
@@ -557,23 +557,21 @@
 copy
-.push(arra
+%5Bn%5D = cop
 y%5Bi%5D
-)
 ;%0A  
@@ -588,71 +588,22 @@
     
-    delete array%5Bi%5D;%0A                    n--;%0A                %7D
+copy%5Bi%5D = tmp;
 %0A   

fix shuffle to run in linear time