updated code gen