update C implementation.