Adding a C implementation