need to port to C.