Updated generate.py, can create functions with arguments and return values and writes the main function into the file