added C function