LZW compression algorithm