Working Huffman tree creation from string