Added Encode/Decode