generated code now compiles and links in Regal, not tested/debugged yet though