Initial implementation in C.