Here is the line of code that I think is the problem and the error that google chrome gives me
a.sort(function(a,b){return a-b});
has no method 'keys'
In firebug on firefox there is no error. This may be a simple error but I am not at all used to chrome's error console.