added table sorted, 2nd round fixes