An implementation for Huffman coding in scala