workable version of 1.5 compress: handle the corner cases