compress: huge overhaul, taking advantage of the reverse-sort input requirement