first step of auto generate