connected the functions for huffman.