finished assignment: huffman encoding