Encode Decode tree