WIP on C version.