New form encoder
Updated version