LZW decompression algorithm reimplementation