finish implementing the decompress function