Improved Compression functions