encoder simplified