some code generator code. doesn't work yet.