Optimized the compression algorithm.