adds generation code