Huffman memory, works with order 3 memory