working version! actually compresses!