add compress functionality