entropy, with code