Added compress function