more WIP C code