Changed to encode/decode