Added length and distance encoders.
Implemented end marker.