codegen: attempt to get head working; segfault