Simple implementation of Huffman algorithm.