Modified sequential Huffman algorithm