first attempt at compression and decompression