updated to managed FFI