huffman coding: add function definitions.