modified cpp side shim to write types properly