Add C implementation. And use a proper method.