Almost have 2-bit enocding working.