cherry-pick performance improvement, it disappeared
Add data as a valid argument.

it seems to work, but it's really slow. I'll optimize it soon.