wip, but compiles and using kr oneman approved data structs on the c side