Added code for compression