fixes in compression and decompression, added estimation