first fully working autogenerating code