Function calls are a little slow in JS, but that would probably be fine.