ugly intermediate state, but beginning of meaningful code gen