modify compress logic