improve the style of huffmanencoder