If you don't need i just use function(d) otherwise, even if you don't need d, you MUST use function(d, i).