initial generation code.