updated to new FFI