modified week4 - huffman coding assignment