be compatible with the C version