Added autogeneration of code, not finished yet