Added new method for compression.