implement huffman decoder