documentation of compress function