finish first version of auto-generating models. Qiu