scala assn encode Huffman B (rough draft, not working).