Working on the encoding problem