Added encode2 to generator.
Updated TODO.