decode function

Decode codes to plain text (and vice versa)