start to gen code