for (var i = 0; i < o.length; i++) {
        if (os[o[i]] == null) os[o[i]] = { rows: new Array(), n: null };
        os[o[i]].rows.push(i);
    }