Since you're not using `v`, you might use the `indmax` function here.