Finished all steps for the initial code-gen, but untested