Huffman Encoding Implementation