for (var i = oldSortSpans.length; i > 0; i--) {
        oldSortSpans[i-1].remove();
    }