added support for C function return