Drafting an encoder.
Minor changes.