R optim multiple parameters. Using optim on a two-variable function.