implemented the lzw decoding