Initial implementation of c function.