exercise 31 - different encodings

this is the original aim of the exercise