Implement new encoding scheme.