implement compress