Added wxRemoveFile to the new generateCodeAndSave() function