potentially final compression function