Entropy based code